export default function (defaultDataVal = null) {
    return {
        data() {
            return {
                data: defaultDataVal,
                isLoading: true
            }
        },
        created() {
            this.fetchData().then((data) => {
                this.data = data;
                this.isLoading = false;
            })
        },
    }
}